import {  CHANGE_ID, REQ_GET_CHANNELS_LIST } from "../constants/channels"
import axios from "axios";
/**
 * 请求数组接口
 * @returns 
 */
 export const reqGetChannelsList = () => {
  return async dispatch => {
    const res = await axios.get('http://geek.itheima.net/v1_0/channels')
    dispatch({
      type:REQ_GET_CHANNELS_LIST,
      payload:res
    })
  }

}
/**
 * 修改ID、
 * @param {*} id 
 * @returns 
 */
export const changeId = (id) => {
  return ({
    type:CHANGE_ID,
    id
  })

}
